package com.breeze.webview;

import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.breeze.base.autoservice.BreezeServiceLoader;
import com.breeze.common.autoservice.IWebViewService;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void openWebView(View view) {
        // startActivity(new Intent(this,WebViewActivity.class));
        // 对获取ServiceLoader进行封装，放到base库
        /*IWebViewService next = ServiceLoader.load(IWebViewService.class).iterator().next();
        next.startWebViewActivity(this, "https://www.baidu.com", "百度", false);*/
        IWebViewService load = BreezeServiceLoader.load(IWebViewService.class);
        // load.startWebViewActivity(this, "https://www.baidu.com", "百度", true);
        load.startDemoHtml(this);
    }
}